<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
 String path = request.getContextPath();
 String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<base href="<%=basePath%>">
	<title>${q } 相关问题  - SegmentFault</title>
	<jsp:include page="../common/_meta.jsp"></jsp:include>
</head>
<body>
	<jsp:include page="../common/_header.jsp"></jsp:include>
		
	<div class="wrap">
		<div class="inner edge">
		    <div class="big-search">
		        <form action="search" method="post" style="position: relative;">
		            <input class="text-42" type="text" name="q" placeholder="输入关键词搜索" value="${q }">
		        </form>
		        <p>找到约 ${fn:length(questionList)}条结果</p>
		    </div>
		    <div id="main">
		        <div id="content" class="all-search-reslut">
		        <c:choose>
		        	<c:when test="${empty questionList }">
		        		<article class="post">
		                	没有任何搜索结果
		        		</article>
		        	</c:when>
		        	<c:otherwise>
		        		<c:forEach var="question" items="${questionList }">
        			        <article class="post q" id="${question.id }">
								<h2><a href="q/${question.id }" title="${question.title }">${question.title }</a></h2>
								<div class="p-excerpt">${question.content }</div>
							</article>
		        		</c:forEach>
		        	</c:otherwise>
		        </c:choose>
                </div><!-- end #content -->
                <jsp:include page="../common/_page.jsp"></jsp:include>
		    </div><!-- end #main -->
		    <div id="secondary">
		        <aside>
		            <a href="ask?ref=${q }" class="btn-medium">我要提问</a><br><br>
		            <ul class="list-menu">
		                <li <c:if test="${tab == null || tab eq 'question' }">class="current"</c:if> >
		                	<a href="search?q=${q }&tab=question">问题</a>
	                	</li>
		                <li <c:if test="${tab eq 'tag' }">class="current"</c:if> >
		                	<a href="search?q=${q }&tab=tag">标签</a>
	                	</li>
		                <li <c:if test="${tab eq 'user' }">class="current"</c:if> >
		                	<a href="search?q=${q }&tab=user">用户</a>
	                	</li>
		            </ul>
		        </aside>
		    </div><!-- end #secondary -->
		</div>
	</div><!-- end .wrap -->

	<jsp:include page="../common/_footer.jsp"></jsp:include>
</body>
</html>